/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
 
/**
 * @version package.h 0.0.1
 * @package Comoro
 * @author Dr.NP <np@bsgroup.org>
 *
 * Data package encoder & decoder header
 */

// Constants
#define PACK_BUFFER_SIZE							16384

// Encode & decode return value
struct edata
{
	char *bindata;
	int len;
};

/* BEGIN OF FUNCTION DEFINE */
char * package_decode							(char*, int, int);
char * package_encode							(char *, int, int);
char * package_pack								(char **, unsigned int, unsigned int *);
char ** package_unpack							(char *, unsigned int, unsigned int *);
void package_output								(char *, unsigned int);
void package_unique_id							(char *, unsigned int);

void put_u_short									(short, char *);
short get_u_short									(char *);
void put_u_int									(unsigned int, char *);
unsigned int get_u_int							(char *);
void put_u_ll										(unsigned long long, char *);
unsigned long long get_u_ll						(char *);
/* END OF FUNCTION DEFINE */
